<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="sec"%>
<%@ taglib uri="http://www.joda.org/joda/time/tags" prefix="joda"%>
<table class="table table-striped table-bordered table-condensed table-hover ">
  <thead>
  <tr>
   <th>序号</th>
   <th>缴库人</th>
   <th>合同</th>
   <th>产品</th>
   <th>批次</th>
   <th>数量</th>
   <th>日期</th>
   <th>管理</th>
   </tr>
  </thead>
  <tbody>
   <c:forEach items="${incomes}" var="item" varStatus="vs">
    <tr>
      <td>${vs.index+1}</td>
      <td>${item.worker.localName}</td>
      <td>${item.contract.name}</td>
      <td>
      <label class="label label-info">
      ${item.owner.code}
      </label>
      -${item.owner.name}</td>
      <td>${item.batchName}</td>
      <td>
      <label class="label label-warning">
      ${item.value}
      </label>
      </td>
      <td>
      <joda:format value="${item.fireDate}" pattern="yyyy年MM月dd日 hh时mm分ss秒" />
      
      </td>
      <td>
        <button class="btn btn-inverse btn-mini" onclick="removeIncome('${item.id}',this)")>
         <i class="icon-remove"></i>
        </button>
      </td>
      
    </tr> 
   </c:forEach>
  
  </tbody>
 </table>
 <script type="text/javascript">
   function removeIncome(id,self){
	   $.post('contract/contract!removeIncome?term='+id,function(){
		   $(self).parent().parent().remove();
	   })  ; 
   }
 </script>